package prueba;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author tlamatron
 */
import java.awt.*;
import javax.swing.*;

//Lienzo
public class Lienzo extends JPanel {

        Carro[] a; //Pasamos el vector que contiene a los carros

	public Lienzo(Carro[] autos){
		a = autos;
	}

	//paintComponent()
	@Override
	protected void paintComponent( Graphics g )
	{
		super.paintComponent(g);
		//g.drawLine(100,10,350,10);
		//g.drawLine(100,100,350,100);

		for(int i=0;i<10;i++){
			if( a[i] != null ) {
				a[i].paint(g);
			}
		}

	}//fin paintComponent()
}
//fin Lienzo
